#include "comm.hpp"

int main()
{
    int fd = open(MAPED_FILE, O_RDWR | O_CREAT, 0666);
    char* addr = (char*)mmap(nullptr, LENGTH, PROT_WRITE, MAP_SHARED, fd, 0);

    char buff[1024] = "hello linux";
    int len = strlen(buff);
    ftruncate(fd, len);
    memcpy(addr, buff, len);
    msync(addr, LENGTH, MS_SYNC);
    log(LOG, "process a send a msg done...");
    close(fd);
    munmap(addr, LENGTH);
    log(LOG, "process a close mmaped_file done...");
    //sleep(5);
    return 0;
}